#ifndef NFCPEERTOPEER_H
#define NFCPEERTOPEER_H

#include <QObject>
#include <qnearfieldmanager.h>
#include <qllcpserver.h>
#include <qllcpsocket.h>

QTM_USE_NAMESPACE  // Use Qt Mobility namespace

class NfcPeerToPeer : public QObject
{
    Q_OBJECT
public:
    explicit NfcPeerToPeer(QObject *parent = 0);

signals:
    void chatMessage(const QString& nfcClientMessage);

public slots:
    void sendText(const QString& text);

private slots:
    void targetDetected(QNearFieldTarget *target);
    void targetLost(QNearFieldTarget *target);
    void handleNewConnection();
    void readText();

private:
    QLatin1String nfcUri;
    QNearFieldManager *nfcManager;
    QLlcpServer *nfcServer;
    QLlcpSocket *nfcClientSocket;
    QLlcpSocket *nfcServerSocket;


};

#endif // NFCPEERTOPEER_H
